package com.homedo.microservice.open.service.gateway.alert.gateway.bean.enums.forzuulfilter;

/**
 * @author 作者 jgshun
 * @date 创建时间 2018年09月10日 16时28分40秒
 */
public enum ProgressEnum4ZuulFilter {
    /**
     * (short) -1, "未发布"
     */
    UNPUBLISHED((short) -1, "未发布"),
    /**
     * (short) 2, "灰度"
     */
    CANARY((short) 2, "灰度"),
    /**
     * (short) 1, "发布中"
     */
    PUBLISHED((short) 1, "已发布");

    private short code;
    private String msg;

    private ProgressEnum4ZuulFilter(short code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public short getCode() {
        return code;
    }

    public void setCode(short code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public static ProgressEnum4ZuulFilter getProgressEnumByCode(short code) {
        for (ProgressEnum4ZuulFilter _enum : ProgressEnum4ZuulFilter.values()) {
            if (_enum.getCode() == code) {
                return _enum;
            }
        }
        return null;
    }
}
